<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div>我是第二个页面</div>
    <div>外部传来的数据为<span id="box"></span></div>
</body>
<script>
    window.addEventListener('message', function (evt) {
        // if(evt.data.){


        // }
        console.log(evt);
        if(evt.data.target !== "metamask-inpage"){
            box.innerHTML =JSON.parse(evt.data)
        }




    }, false); 
</script>

</html>